package cn.cpf.app.gobang.modal;

import cn.cpf.app.gobang.global.Config;
import lombok.NonNull;

import javax.swing.*;

public class Piece extends JLabel {

	private static final long serialVersionUID = 1L;

	private final Part part; // 势力

	public Piece(@NonNull Place place, @NonNull Part part, @NonNull Icon icon) {
		this.setSize(Config.PIECE_WIDTH, Config.PIECE_HEIGHT);
		this.setIcon(icon);
		setLocation(place.x * Config.PIECE_WIDTH, place.y * Config.PIECE_WIDTH);
		this.part = part;
	}

	public Part getPart() {
		return part;
	}

}
